<?php

include_once('appBootstrap.php');

$frontController->setBaseUrl(dirname($_SERVER['SCRIPT_NAME']));

$doctypeHelper = new Zend_View_Helper_Doctype();
$doctypeHelper->doctype('XHTML1_STRICT');

$options = array(
				 'layoutPath' => dirname(__FILE__) . '/application/views/layouts/',
      		     'layout'=>'default'
				);

$layout = Zend_Layout::startMvc($options);
$view = $layout->getView();
$view->baseUrl = $frontController->getBaseUrl();
$view->addHelperPath("ZendX/JQuery/View/Helper", "ZendX_JQuery_View_Helper");
$view->jQuery()->setLocalPath($frontController->getBaseUrl() . '/application/public/jquery/jquery-1.3.2.min.js');
$view->jQueryBaseUrl = dirname($view->jQuery()->getLocalPath());
$view->jQuery()->enable()->uiEnable();
//$view->jQuery()->setRenderMode(0);

if (getenv('BPD_ROLE') == 'dev') Zend_Registry::set('context','staging');
else Zend_Registry::set('context','production');
// run!
$frontController->setParam('session', new Zend_Session_Namespace('kpl'));
$frontController->dispatch();
